home *** CD-ROM | disk | FTP | other *** search
/ LSD Docs / LSD Docs.iso / FILEZ / lsd21.dms / lsd21.adf / AtariST.PictureFormats.pp / AtariST.PictureFormats
Text File  |  1990-09-07  |  14KB  |  290 lines

  1. ---------------------------------------------------------------------------
  2.                            ST Picture Formats
  3.                            ------------------
  4.                               Compiled by:
  5.                               Dave Baggett
  6.                          (arpanet: dmb@TIS.COM)
  7.                    (Please report errors or additions)
  8.                               CONTRIBUTORS
  9.     Phil Blanchfield   Jason Blochowiak   David Brooks   Neil Forsyth   
  10.          Ken MacLeod   Jim McCabe   Darek Mihocka   David Mumper   
  11.           George Seto   Joe Smith   Greg Wageman  Gerry Wheeler
  12.  
  13.                                 Contents 
  14.                                 --------
  15. NEOchrome                       NEOchrome Animation             DEGAS   
  16. DEGAS Elite (Uncompressed)      DEGAS Elite (Compressed)        Tiny
  17. Spectrum 512 (Uncompressed)     C.O.L.R. Object Editor Mural    MacPaint
  18. Spectrum 512 (Compressed)       Animatic Film
  19.  
  20.                         Introductory Information
  21.                         ------------------------
  22.  
  23. word    = 2 bytes
  24. long    = 4 bytes
  25. palette = Hardware color palette, stored as 16 words.  First word is
  26.           color register zero (background), last word is color register
  27.           15.  Each word has the form:
  28.           Bit:  (MSB) 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 (LSB)
  29.                       -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  30.                        0  0  0  0  0 R2 R1 R0  0 G2 G1 G0  0 B2 B1 B0
  31.           R2 = MSB of red intensity
  32.           R0 = LSB of red intensity
  33.           G2 = MSB of green intensity
  34.           G0 = LSB of green intensity
  35.           B2 = MSB of blue intensity
  36.           B0 = LSB of blue intensity
  37.           Intensity ranges from 0 (color not present) to 7 (highest
  38.           intensity).
  39.           Example: { red = 7, green = 3, blue = 5 } -> 0735 (hex)
  40.           Caveat:  It is wise to mask off the upper four bits of each
  41.                    palette entry, since a few programs store special
  42.                    information there (most notably Art Studio).
  43.  
  44.                              The Formats
  45.                              -----------
  46. <NEOchrome>
  47. 1 long          resolution (0 = loew res, 1 = medium res, 2 = high res)
  48. 16 words        palette
  49. 12 bytes        filename (usually "        .   ")
  50. 1 byte          unused (usually either 80 hex or 0)
  51. 1 byte          color animation limits (4 most significant bits are 
  52.                 left/lower limit; 4 least significant bits are 
  53.                 right/upper limit).
  54. 1 byte          color animation enabled?  High bit set if yes.
  55. 1 byte          color animation speed and direction
  56.                 x = 0 means animation stopped
  57.                 x < 0 means colors cycle to the left (decreasing)
  58.                 x > 0 means colors cycle to the right (ascending)
  59.                 Number of vblanks between cycles is |x| - 1
  60. 19 longs        reserved for expansion
  61. 16000 words     picture data (screen memory)
  62. -----------
  63. 32128 bytes     total
  64.  
  65.  
  66. <NEOchrome Animation>
  67. NOTE:      To get this feature on versions 0.9 and later select the Grabber
  68.         icon and click the both mouse buttons in the eye of the second R in
  69.         the word GRABBER.
  70.            Interestingly enough, some versions of NEO only require you
  71.         to press the right button, not both.  Hmmm...
  72. 1 long          magic number BABEEBEA (hex) (seems to be ignored)
  73. 1 word          width of image in bytes (always divisible by 8)
  74. 1 word          height of image in scan lines
  75. 1 word          size of image in bytes + 10 (!)
  76. 1 word          x coordinate of image (must be divisible by 16) - 1
  77. 1 word          y coordinate of image - 1
  78. 1 word          number of frames
  79. 1 word          animation speed (# vblanks to delay between frames)
  80. 1 long          reserved; should be zero
  81. --------
  82. 22 bytes        total for header
  83. ? words         image data (words of screen memory) for each frame, in 
  84.                 order
  85.  
  86.  
  87. <DEGAS>
  88. 1 word          resolution (0 = low res, 1 = medium res, 2 = high res)
  89.                 Other bits may be used in the future; use a simple bit
  90.                 test rather than checking for specific word values.
  91. 16 words        palette
  92. 16000 words     picture data (screen memory)
  93. -----------
  94. 32034 bytes     total
  95.  
  96.  
  97. <DEGAS Elite (Uncompressed)>
  98. 1 word          resolution (0 = low res, 1 = medium res, 2 = high res)
  99.                 Other bits may be used in the future; use a simple bit
  100.                 test rather than checking for specific word values.
  101. 16 words        palette
  102. 16000 words     picture data (screen memory)
  103. 4 words         left color animtion limit table (starting color numbers)
  104. 4 words         right color animation limit table (ending color numbers)
  105. 4 words         animation channel direction flag (0 = left, 1 = off, 2 = right)
  106. 4 words         animation channel delay in 1/60's of a second. [0 - 128]
  107. -----------
  108. 32066 bytes     total
  109.  
  110.  
  111. <DEGAS Elite (Compressed)>
  112. 1 word          resolution (same as Degas, but high order bit is set;
  113.                 i.e., hex 8000 = low res, hex 8001 = medium res,
  114.                 hex 8002 = high res).  Other bits may be used in the
  115.                 future; use a simple bit test rather than checking
  116.                 for specific word values.
  117. 16 words        palette
  118. < 32000 bytes   control bytes
  119. 4 words         left color animtion limit table (starting color numbers)
  120. 4 words         right color animation limit table (ending color numbers)
  121. 4 words         animation channel direction flag (0 = left, 1 = off, 2 = right)
  122. 4 words         animation channel delay in 1/60's of a second. [0 - 128]
  123. -----------
  124. < 32066 bytes   total
  125. Control byte meanings:
  126.         For a given control byte, x:
  127.         0 <= x <= 127   Use the next x + 1 bytes literally (no repetition)
  128.         -127 <= x <= -1 Use the next byte -x + 1 times
  129.         -128            No operation (ignore)
  130. Compression Scheme:
  131.    Each scan line is compressed separately; i.e., all data for a given
  132. scan line appears before any data for the next scan line.  The scan lines
  133. are specified from top to bottom (i.e., 0 is first).  For each scan line,
  134. all the data for a given bit plane appears before any data for the next
  135. higher order bit plane.
  136.    To clarify:  The first data in the file will be the data for the highest
  137. order bit plane of scan line zero, followed by the data for the next lower
  138. order bit plane of scan line zero, etc., until all bit planes have been
  139. specified for scan line zero.  The next data in the file will be the data
  140. for the highest order bit plane of scan line one, followed by the data for
  141. the next lower order bit plane of scan line one, etc., until all bit planes
  142. have been specified for all scan lines.
  143. <C.O.L.R. Object Editor Mural>
  144. 16000 words     picture data (screen memory)
  145.                 (palettes are stored in separate files)
  146. -----------
  147. 32000 bytes     total
  148.  
  149.  
  150. <Tiny>
  151.    Several people have reported sightings of mutated Tiny pictures
  152. that do not follow the standard format, so let's be careful out there. 
  153. What is described here is the format David Mumper's original TNYSTUFF.PRG 
  154. produces.
  155. 1 byte          resolution (same as NEO, but +3 indicates rotation
  156.                 information also follows)
  157. If resolution > 2 {
  158. 1 byte          left and right color animation limits.  High 4 bits
  159.                 hold left (start) limit; low 4 bits hold right (end)
  160.                 limit
  161. 1 byte          direction and speed of color animation (negative value
  162.                 indicates left, positive indicates right, absolute value
  163.                 is delay in 1/60's of a second.
  164. 1 word          color rotation duration (number of iterations)
  165. }
  166. 16 words        palette
  167. 1 word          number of control bytes
  168. 1 word          number of data words
  169. 3-10667 bytes   control bytes
  170. 1-16000 words   data words
  171. -------------
  172. 42-32044 bytes  total
  173. Control byte meanings:
  174.         For a given control byte, x:
  175.         x < 0   Absolute value specifies the number of unique words to
  176.                 take from the data section (from 1 to 127)
  177.         x = 0   1 word is taken from the control section which specifies
  178.                 the number of times to repeat the next data word (from
  179.                 128 to 32767)
  180.         x = 1   1 word is taken from the control section which specifies
  181.                 the number of unique words to be taken from the data
  182.                 section (from 128 - 32767)
  183.         x > 1   Specifies the number of times to repeat the next word
  184.                 taken from the data section (from 2 to 127)
  185. Format of expanded data:
  186.    The expanded data is not simply screen memory bitmap data; instead, the 
  187. data is divided into four sets of vertical columns.  (This results in
  188. better compression.)  A column consists of one specific word taken
  189. from each scan line, going from top to bottom.  For example, column 1 
  190. consists of word 1 on scanline 1 followed by word 1 on scanline 2, etc., 
  191. followed by word 1 on scanline 200.
  192.    The columns appear in the following order:
  193.    1st set contains columns 1, 5,  9, 13, ..., 69, 73, 77 in order
  194.    2nd set contains columns 2, 6, 10, 14, ..., 70, 74, 78 in order
  195.    3rd set contains columns 3, 7, 11, 15, ..., 71, 75, 79 in order
  196.    4th set contains columns 4, 8, 12, 16, ..., 72, 76, 80 in order
  197. Note that Tiny partitions the screen this way regardless of resolution; i.e., 
  198. these aren't bitplanes.  For example, medium resoltion only has two bitplanes, 
  199. but Tiny still divides the medium resolution pictures into four parts.
  200. <Spectrum 512 (Uncompressed)>
  201. 80 words        first scan line of picture (unused) -- should be zeroes
  202. 15920 words     picture data (screen memory) for scan lines 1 through 199
  203. 9552 words      3 palettes for each scan line (the top scan line is
  204.                 not included because Spectrum 512 can't display it)
  205. -----------
  206. 51104 bytes     total
  207.  
  208.  
  209. <Spectrum 512 (Compressed)>
  210. 1 word          5350 (hex) ("SP")
  211. 1 word          0 (reserved for future use)
  212. 1 long          length of data bit map
  213. 1 long          length of color bit map
  214. <= 32092 bytes  compressed data bit map
  215. <= 17910 bytes  compressed color bit map
  216. --------------
  217. < 50014 bytes   total
  218. Data compression:
  219.    Compression is via a modified run length encoding (RLE) scheme,
  220. similar to DEGAS compressed and Tiny.  The data map is stored as a
  221. sequence of records.  Each record consists of a header byte followed by
  222. one or more data bytes.  The meaning of the header byte is as follows:
  223.         For a given header byte, x:
  224.         0 <= x < 127    Use the next x + 1 bytes literally (no repetition)
  225.         -128 <= x < 0   Use the next byte -x + 2 times
  226. The data appears in the following order:
  227.         1. Picture data, bit plane 0, scan lines 1 - 199
  228.         2. Picture data, bit plane 1, scan lines 1 - 199
  229.         3. Picture data, bit plane 2, scan lines 1 - 199
  230.         4. Picture data, bit plane 3, scan lines 1 - 199
  231. Decompression of data ends when 31840 data bytes have been used.
  232. Color map compression:
  233.    Each 16-word palette is compressed separately.  There are three
  234. palettes for each scan line (597 total).  The color map is stored as a
  235. sequence of records.  Each record starts with a 1-word bit vector which
  236. specifies which of the 16 palette entries are included in the data
  237. following the bit vector (1 = included, 0 = not included; i.e., stays
  238. the same).  The least significant bit of the bit vector refers to
  239. palette entry zero, while the most significant bit refers to palette
  240. entry 15.  Bit 15 must be zero, since Spectrum 512 does not use palette
  241. entry 15.  Bit 0 should also be zero, since Spectrum 512 always makes the
  242. background color black.
  243.    The words specifying the values for the palette entries indicated in
  244. the bit vector follow the bit vector itself, in order (0 - 15).
  245.    Yes, it is hideously complex.
  246.  
  247.  
  248. <Animatic Film>
  249. 1 word          number of frames
  250. 16 words        palette
  251. 1 word          speed (0 - 99; value is 99 - # vblanks to delay between frames)
  252. 1 word          direction (0 = forwards, 1 = backwards)
  253. 1 word          end action (what to do after the last frame)
  254.                 0 = pause, then repeat from beginning
  255.                 1 = immediately repeat from beginning
  256.                 2 = reverse
  257. 1 word          width of film in pixels
  258. 1 word          height of film in pixels
  259. 1 word          Animatic version number (major)
  260. 1 word          Animatic version number (minor)
  261. 1 long          magic number 27182818 (hex)
  262. 3 longs         reserved for expansion (should be all zeros)
  263. --------
  264. 32 words        total for header
  265. ? words         image data (words of screen memory) for each frame, in order
  266.  
  267.  
  268. <MacPaint>
  269.    Word has it that this is wrong.  Someone please send me a correction!
  270. header {
  271. 1 long          version number (if zero, entire header is ignored)
  272. 38 * 2 longs    pattern data (anyone know how to use this?)
  273. 83 longs        reserved
  274. }                            (total 160 longwords for header)
  275. < 51200 bytes   compressed bitmap data
  276. -------------
  277. < 51716 bytes   total
  278. Bitmap compression:
  279.    The bitmap data is for a 576 pixel by 720 pixel monochrome image.
  280. The data is stored as a sequence of records.  Each record consists of a
  281. control byte followed by one or more data bytes.  The meaning of the
  282. control byte is as follows:
  283.         For a given control byte, x:
  284.         0 < x < 127     Use the next x + 1 bytes literally (no repetition)
  285.         -128 <= x <= 0  Use the next byte -x + 1 times
  286. There are 72 bytes per scan line.  Each bit represents one pixel; 0 = white,
  287. 1 = black.
  288. Version of Wed Oct 25 00:56:54 EDT 1989
  289. ------------------------------
  290.